<template>
    <div class="dispatch-title">
        <div class="dispatch-early-warning">司机看板</div>
        <div style="padding:20px 26px;overflow:hidden;display: flex;justify-content: space-between">
            <div class="dispatch-list dispatch-left" v-for="(item,index) in dataList" :key="index"  v-if="item.twoName">
                <div class="title color9B9B9B" style="padding-top: 10px">{{item.name}}</div>
                <div class="num">{{item.count}}<span class="fonts">人</span></div>
                <div v-if="item.twoName.length == 2">
                    <div class="borderb"></div>
                    <div class="dispatch-list-fonts" v-for="item2 in item.twoName" ><div class="color9B9B9B">{{item2.name}}</div><div class="borderr"></div><div>{{item2.count}}人</div></div>
                </div>
                <div v-if="item.twoName.length == 1">
                    <div v-for="item2 in item.twoName" >
                        <div class="borderb"></div>
                        <div class="color9B9B9B">{{item2.name}}</div>
                        <div class="num">{{item2.count}}人</div>
                    </div>
                </div>
            </div>
            <div class="dispatch-list dispatch-right"  v-for="(item,index) in dataList" :key="index"  v-if="!item.twoName">
                <div class="title colorFF8D00" style="font-size: 14px;">{{item.name}}</div>
                <div class="num">{{item.count}}<span class="fonts">人</span></div>
            </div>
            <!--<div class="dispatch-list dispatch-left">-->
                <!--<div class="title color9B9B9B" style="padding-top: 10px">上班司机</div>-->
                <!--<div class="num">190<span class="fonts">人</span></div>-->
                <!--<div class="borderb"></div>-->
                <!--<div class="title color9B9B9B">休息司机</div>-->
                <!--<div class="num">10<span class="fonts">人</span></div>-->
            <!--</div>-->
            <!--<div class="dispatch-list dispatch-right">-->
                <!--<div class="title colorFF8D00" style="font-size: 14px;">司机异常超区</div>-->
                <!--<div class="num">30<span class="fonts">人</span></div>-->
            <!--</div>-->
            <!--<div class="dispatch-list dispatch-right">-->
                <!--<div class="title colorFF8D00" style="font-size: 14px;">司机异常停留</div>-->
                <!--<div class="num">30<span class="fonts">人</span></div>-->
            <!--</div>-->
            <!--<div class="dispatch-list dispatch-right">-->
                <!--<div class="title colorFF8D00" style="font-size: 14px;">司机1小时无任务</div>-->
                <!--<div class="num">30<span class="fonts">人</span></div>-->
            <!--</div>-->
            <!--<div class="dispatch-list dispatch-right">-->
                <!--<div class="title colorFF8D00" style="font-size: 14px;">司机今日任务<5</div>-->
                <!--<div class="num">30<span class="fonts">人</span></div>-->
            <!--</div>-->
        </div>
    </div>
</template>
<script>
    export default {
        components: {
        },
        props: {
            value: {
                type: Array,
                default: () => {
                    return [];
                }
            }
        },

        data() {
            return {
                dataList: []
            }
        },
        watch: {
            value: {
                handler(val){
                    this.dataList = this.value;
                },
                deep: true
            },
            dataList: {
                handler(val){
                    this.$emit('input',this.dataList);
                },
                deep: true
            }
        },
        mounted() {
        },
        methods: {}
    }
</script>
<style lang="less" scoped>

.dispatch-title{
    background-color: #fff;
        .dispatch-early-warning{
            box-sizing: border-box;
            font-size: 16px;
            padding:10px 0 6px 25px;
            margin-bottom: 2px;
            background-color: #fff;
            border-bottom: 2px solid #f4f4f4;
        }
    .colorFF8D00{
        color: #FBA805;
    }
    .color9B9B9B{
        color: rgba(155,155,155,0.7);
    }
    .fonts{
        font-size: 20px;
        font-weight: 600;
    }
    .dispatch-left{
        text-align: center;
        background:rgba(126,211,33,0.04);
        border-top:2px solid #5FB878;
    }

    .dispatch-right{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background:rgba(211,75,33,0.04);
        border-top:2px solid #F12F1D;
    }
    .dispatch-list{
        width:137px;
        height: 110px;
        /*float: left;*/
        border-radius:2px;
        /*margin-right: 60px;*/
        margin-bottom: 20px;
        .title{
            font-size:12px;
        }
        .num{
            font-size:22px;
            font-weight: 600;
            color:rgba(0,0,0,0.85);
        }
        .borderb{
            width:96px;
            height:2px;
            background-color: #5FB878;
            margin: 0px auto;

        }
        .dispatch-list-fonts{
            font-size: 12px;
            /*padding-top: 2px;*/
            display: flex;
            justify-content: center;
            align-items: center;
            .borderr{
                width:2px;
                height:12px;
                margin: 0 4px;
                background-color: #5FB878;
            }
        }
    }
}
</style>

